@using Extension
@inherits PageBase

@if (Ref != null)
{
    @if (OnlyName)
    {
        <ColorfulTag OnClick="@OnObjClick" Style="cursor: pointer" ColorKey="@Ref.Name" Color="@Color">

            <Tooltip>
                <TitleTemplate>
                    @($"{Ref.ApiVersion}/{Ref.Kind}/{Ref.NamespaceProperty}/{Ref.Name}")
                </TitleTemplate>
                <ChildContent>
                    @($"{Ref.Name}")
                </ChildContent>
            </Tooltip>
        </ColorfulTag>
    }
    else
    {
        <ColorfulTag OnClick="@OnObjClick" Style="cursor: pointer" ColorKey="@Ref.Kind" Color="@Color">
            <Tooltip>
                <TitleTemplate>
                    @($"{Ref.ApiVersion}/{Ref.Kind}/{Ref.NamespaceProperty}/{Ref.Name}")
                </TitleTemplate>
                <ChildContent>
                    @if (FullView)
                    {
                        <span>@($"{Ref.Kind}") &nbsp;</span>
                        @if (Ref.NamespaceProperty.IsNullOrWhiteSpace())
                        {
                            @($"{Ref.Name}")
                        }
                        else
                        {
                            @($"{Ref.NamespaceProperty}/{Ref.Name}")
                        }
                    }
                    else
                    {
                        @($"{Ref.Kind}")
                    }
                </ChildContent>
            </Tooltip>
        </ColorfulTag>
    }
}
